const express = require('express');
const router = express.Router();

const adminAuthMiddleware = require('../../middleware/adminAuth');
const adminAuthRoutes = require('./auth');
const adminProductRoutes = require('./product');
const adminCategoryRoutes = require('./category');
const adminBrandRoutes = require('./brand');
const adminUserRoutes = require('./user');

// 应用管理后台认证中间件
router.use(adminAuthMiddleware);

// 管理后台路由
router.use('/auth', adminAuthRoutes);
router.use('/products', adminProductRoutes);
router.use('/categories', adminCategoryRoutes);
router.use('/brands', adminBrandRoutes);
router.use('/users', adminUserRoutes);

module.exports = router; 